﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ColorMix
{
    public partial class Form2 : Form
    {
        private Bitmap Diff;
        private string title;
        public Form2(Bitmap diffuse, string title)
        {
            //pictureBox1.Image = diffuse;
            this.Diff = diffuse;
            pictureBox1 = new PictureBox();
            pictureBox1.InitialImage = diffuse;
            this.title = title;
            this.Text = title;
            InitializeComponent();
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            SaveFileDialog savedlg = new SaveFileDialog();
            savedlg.Filter = "Imagen PNG (*.png)|*.png";
            savedlg.FileName = title;
            if (savedlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Diff.Save(savedlg.FileName, System.Drawing.Imaging.ImageFormat.Png);
            }
        }
    }
}
